import request from '@/utils/request'

/**
 * 通过code换取网页授权access_token 通过code换取网页授权access_token
 * null
 */
export const getUserInfo = (code: string) => {
  return request({
    url: `wx/getAccessTokenByCode/${code}`,
    method: 'POST',
  })
}

/**
 * 公众号登录并绑定 新用户第一次登录
 * null
 */
export const bindLogin = (data: any) => {
  return request({
    url: 'wx/bindLogin',
    method: 'POST',
    data,
  })
}

/**
 * 租户下拉选项
 * @ss.hasPermi('license:tenant')
 */
export const tenantOption = (params?: any) => {
  return request({
    url: '/license/tenantOption',
    method: 'GET',
    params,
  })
}

/**
 * 用户解绑 用户解绑
 * null
 */
export const cancelBindUser = (openId: string) => {
  return request({
    url: `wx/cancelBind/${openId}`,
    method: 'POST',
  })
}
